package c05面向对象;

public class 切换this指向测试 {

	public static void main(String[] args) {
		A a = new A();
		a.print();
		B b = new B();
//		a.print = a.print; //java 不能把一个方法名赋值给另一个方法名
	}

	static class A {
		private String name = "a";

		private void print() {
			System.err.println(this.name);
		}
//		private void test = System.err.println();
	}

	static class B {
		private String name = "b";

		private void print() {
			System.err.println(this.name);
		}
	}
}
